package com.zhouyer.study.service.feign;

import com.zhouyer.study.service.fallback.EmailFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 邮件服务Feign本地接口
 *
 * @author zhouyao
 * @version 1.0
 * @date 2021/12/7 8:30 上午
 */
@FeignClient(value = "zhouyer-service-email", fallback = EmailFeignClientFallback.class, path = "/email")
public interface EmailFeignClient {
    /**
     * 发送邮件
     *
     * @param email 邮箱地址
     * @param code  验证码
     * @return boolean
     * @author zhouyao
     * @date 2021/12/7 8:34 上午
     */
    @GetMapping("/{email}/{code}")
    public boolean sendEmail(@PathVariable("email") String email, @PathVariable("code") String code);
}
